﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebUI.Controls
{
    public partial class EditCustomerTypeCtrl : BaseEditControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            base.Page_Load(sender, e);
        }

        public string TypeName
        {
            get { return txtName.Text; }
            set { txtName.Text = value; }
        }

        public int CustomerPrice
        {
            get 
            {
                if (rbSale.Checked) return 1;
                if (rbDealer.Checked) return 2;
                return 3;
            }
            set 
            {
                rbDealer.Checked = value == 2;
                rbSale.Checked = value == 1;
                rbPartner.Checked = value == 3;
            }
        }
    }
}